package com.xbfinal.educms.controller;

import com.xbfinal.commonUtils.Result;
import com.xbfinal.educms.entity.CrmBanner;
import com.xbfinal.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title: BannerFrontController
 * @Author 笑霸fianl
 * @Package com.xbfinal.educms.controller
 * @Date 2023/2/27 16:34
 * @描述: 前台
 */
@RestController
@RequestMapping("/educms/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;




    //查询所有banner
    @Cacheable(cacheNames = "banner",key = "'selectIndexList'")
    @GetMapping("getAllBanner")
    public Result getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return Result.ok().add("list",list);
    }
}
